'''下拉选择'''
from selenium import webdriver
from selenium.webdriver.support.select import Select
from time import sleep

driver =webdriver.Chrome()
driver.implicitly_wait(10)
driver.get('https://www.baidu.com')

# 鼠标悬停至“设置”链接
driver.find_element_by_link_text('设置').click()
sleep(1)
# 打开搜索设置
driver.find_element_by_link_text('搜索设置').click()
sleep(2)

# 搜索结果显示条数
sel = driver.find_element_by_xpath('//select[@id="nr"]')
Select(sel).select_by_value('50') # 显示50条

driver.close()


